from bs4 import BeautifulSoup

data = []
path = './web/new_index.html'

'''
 body > div.main-content > ul > li:nth-child(1) > img
 body > div.main-content > ul > li:nth-child(1) > div.article-info > h3 > a
 body > div.main-content > ul > li:nth-child(1) > div.article-info > p.meta-info > span:nth-child(1)
 body > div.main-content > ul > li:nth-child(1) > div.rate > span
 body > div.main-content > ul > li:nth-child(1) > div.article-info > p.description
'''

with open(path, 'r') as f:
    soup = BeautifulSoup(f.read(), 'lxml')

    image = soup.select('body > div.main-content > ul > li > img')
    title = soup.select("body > div.main-content > ul > li > div.article-info > h3 > a")
    tag = soup.select("body > div.main-content > ul > li > div.article-info > p.meta-info")
    point = soup.select("body > div.main-content > ul > li > div.rate > span")
    desc = soup.select("body > div.main-content > ul > li > div.article-info > p.description")

for title, image, tag, point, desc in zip(title, image, tag, point, desc):
    info = {
        "title": title.get_text(),
        "tag": list(tag.stripped_strings),
        "point": point.get_text(),
        "desc": desc.get_text(),
        "image": image.get("src")
    }
    data.append(info)

for i in data:
    if float(i["point"])>3:
        print(i["title"],i["point"])